package dao.jpa;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import dao.ContaDAO;
import entity.Conta;
import entity.ContaCredito;

@Repository
public class ContaJpaDAO extends GenericJpaDAO<Conta> implements ContaDAO,
		Serializable {

	private static final long serialVersionUID = -103013773105778419L;

	@SuppressWarnings("unchecked")
	@Override
	public List<ContaCredito> listarContasCreditosAtivas() {

		final Criteria criteria = criarCriteria(ContaCredito.class);

		criteria.add(Restrictions.eq("ativo", true));

		return criteria.list();

	}

}
